<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>产品入库详情</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="/static/css/font.css">
        <link rel="stylesheet" href="/static/css/xadmin.css">
		<link rel="stylesheet" href="/static/css/table.css">
        <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="/static/js/xadmin.js"></script>
        <script type="text/javascript" src="/static/js/jquery.min.js"></script>
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="x-nav">
          <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>入库产品信息</li>
							  </ul>
							  <div class="layui-tab-content">
								 <table class="layui-table">
                                    <tr>
                                        <td colspan='2'>入库门店：{$info.shop_id}</td>
                                    </tr>
                                    <tr>
                                        <td colspan='2'>入库时间：{$info.addtime|date="Y-m-d H:i",###}</td>
                                    </tr>
                                    <tr>
                                        <td colspan='2'>产品名称：{$info.goods_name}</td>
                                    </tr>
                                    <tr>
                                        <td>产品分类：{$info.category_id}</td>
                                        <td>产品子分类：{$info.cat_id}</td>
                                    </tr>
                                    <tr>
                                        <td>产品品牌：{$info.brand_name}</td>
                                        <td>产品型号：{$info.marker}</td>
                                    </tr>
                                    <tr>
                                        <td>内存：{$info.memory_name}</td>
                                        <td>属性：{$info.attribute_name}</td>
                                    </tr>
                                    <tr>
                                        <td>产品颜色：{$info.colour_name}</td>
                                        <td></td>
                                    </tr>
                                 </table>
							  </div>
							</div>
							<div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>入库数量</li>
							  </ul>
							  <div class="layui-tab-content">
								 <span>采购数量：{$info.pur_number}</span>
								 <span style="margin-left:30px;">单位：{$info.unit}</span>
							  </div>
							</div>
							<div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>进货价</li>
							  </ul>
							  <div class="layui-tab-content">
								 <span>进货单价：{$info.buying_price}元</span>
								 <span style="margin-left:30px;">合计进货总价：{$info.total_money}元</span>
							  </div>
							</div>
                            <div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>产品供应商</li>
							  </ul>
							  <div class="layui-tab-content">
								 <span>供应商：{$info.supplier_id}</span>
							  </div>
							</div>
                            <div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>入库情况记录</li>
							  </ul>
							  <div class="layui-tab-content">
                                 入库情况：
                                 {switch name="$info.state"}
                                    {case value="0"}正常{/case}
                                    {case value="1"}已售{/case}
                                    {case value="2"}已过期{/case}
                                {/switch}
							  </div>
							</div>
                        </div>
                        <div class="layui-card-body ">
                            <table class="layui-table layui-form" id="dataTables-example"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script>
        var goods_id = "{$info.goods_id}";
            layui.use(['form','table', 'layer'],
                function() {
                    $ = layui.jquery;
                    var form = layui.form,
                    layer = layui.layer;
                    var table = layui.table;

                    /*初始化表格*/
                    function tableInit(where = {})
                    {  
                      table.render({
                        elem: '#dataTables-example'
                        ,url:'/admin/goods/gstocklist.html'
                        ,where:where
                        ,method:'POST'
                        ,parseData: function(res){ //res 即为原始返回的数据
                            //封装返回数据
                            console.log(res);
                            return {
                              "code": 10001, //解析接口状态
                              "msg": '', //解析提示文本
                              "count": res.total, //解析数据长度
                              "data": res.data //解析数据列表
                            };
                        }
                        ,cols: [[
                          {field:'stock_id', title: '序号'}
                          ,{field:'goods_name', title: '产品名称'} 
                          ,{field:'imei', title: 'IEMI'}
                          ,{field:'sn', title: 'S/N'}
                          ,{field:'period_time', title: '保质期'}
                          ,{field:'number', title: '数量'}
                          ,{field:'unit', title: '单位'}
                          ,{field:'buying_price', title: '进货单价（元）'}
                          ,{field:'supplier_id', title: '供应商'}
                          ,{field:'contract_sn', title: '合同编号'}
                          ,{field:'position', title: '所在位置'}
                        ]]
                        ,page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
                          layout: ['prev', 'page', 'next', 'skip', 'count']
                        }
                        ,response: {
                            statusCode: 10001
                        }
                      });
                    }
                    tableInit({id:goods_id});
                });
        </script>
    </body>
</html>